<%@ page language="java" import="java.util.*,com.edu.ujn.myh.domain.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="js/rolePriv.js"></script>
  </head>
  
  <body style="background-color : #E8F2FE;">
   <% List rolePrivList = (List)request.getAttribute("rolePrivList"); %>
  <div>
			<fieldset class="query" style="margin-left: 35px;margin-right: 35px;margin-top:10px;border : 1px solid #7C7CC6;">
				<legend>权限管理</legend>
				<form id="rolePrivModify" name="rolePrivModify" action="roleModifyAction.action" method="post" >
				<input type="hidden" name="roleId" id="roleId" value="${roleId}">
				<div id="div1" onclick="postBackByObject()" style="font-size :40pt;margin-left:90px">
					<% if(rolePrivList!=null&&rolePrivList.size()>0){
						for(int i=0;i<rolePrivList.size();i++){
							TreeNode root = (TreeNode)rolePrivList.get(i);
							if(root.isChecked()==true){
					%>
					<table style="font-size :10pt;">
						<tr align="left">
							<td width="200">
							<input type="checkbox"  name="checkbox" id="ch<%=i%>CheckBox" checked="checked" value="<%=root.getNodeId() %>"><%=root.getNodeName()%><br/>
							</td>
						</tr>
					</table>	
					<%}else { %>
					<table style="font-size :10pt;">
						<tr align="left">
							<td width="200">
							<input type="checkbox" name="checkbox" id="ch<%=i%>CheckBox" value="<%=root.getNodeId() %>"><%=root.getNodeName()%><br/>
							</td>
						</tr>
					</table>	
					<%} %>
					<div id="ch<%=i%>Nodes">
					<% 
							List children = root.getChildren();
							for(int j=0;j<children.size();j++){
							TreeNode child = (TreeNode)children.get(j);
							if(child.isChecked()==true){
					 %>
					
					 <table style="font-size :10pt;">
						<tr align="left">
							<td width="200">
						    <input style="margin-left:30px" type="checkbox" name="checkbox" id="<%=child.getNodeId() %>" value="<%=child.getNodeId() %>" checked="checked"><%=child.getNodeName()%><br/>
							</td>
						</tr>
					</table>	
					 <%} 
					 else{
						%>
						<table style="font-size :10pt;">
						<tr align="left" >
							<td width="200">
							<input style="margin-left:30px" type="checkbox" name="checkbox" id="<%=child.getNodeId() %>" value="<%=child.getNodeId() %>"><%=child.getNodeName()%><br/>
							</td>
						</tr>
					</table>	
						<%					 
					 }
					 } 
						%>
				
					</div>	
					<% 
					 }} else { %>
					 		没有角色数据
					 <% }%>
					</div> 
					<div>
					<table style="margin-left:90px">
							<tr>
								<td>
									<input type="submit" value="提交" style="font-size:10px;">
								</td>
								<td>
									<input type="reset" value="重置" style="font-size:10px;margin-left:20px">
								</td>
							</tr>
					</table>
						
					</div>
				</form>
			</fieldset>
		</div>
  </body>
</html>
